
if (!globalThis.CustomEvent) {
    class CustomEvent<T> extends Event {
        detail: T;
        constructor(message: string, data?: EventInit & { detail: T }) {
            super(message, data);
            // @ts-ignore
            this.detail = data?.detail;
        }
    };
    // @ts-ignore
    globalThis.CustomEvent = CustomEvent;
}